<style lang="less">
@import "./supplierManage.less";
</style>
<template>
  <Modal :title="reviewModalTitle" v-model="isShow" :mask-closable='false' :width="500" @on-cancel="cancelReview">
    <Form ref="reviewForm" :model="reviewForm" :label-width="100" :rules="reviewFormValidate">
        <FormItem label="审核状态" prop="reviewStatus">
            <RadioGroup v-model="reviewForm.reviewStatus" @on-change="revewStatusChange">
              <Radio label="0">未审核</Radio>
              <Radio label="-1">未通过</Radio>
              <Radio label="1">通过</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="原因描述" prop="nopassReason" v-if="reviewForm.nopassReasonVisible">
            <textarea v-model="reviewForm.nopassReason" style="width:340px;height:60px;resize:none;line-height:2.0;border:1px solid #dddee1;"/>
        </FormItem>          
    </Form>
    <div slot="footer">
        <Button type="text" @click="cancelReview">取消</Button>
        <!-- <Button type="primary" :loading="submitLoading" @click="submitHotelReview">提交</Button> -->
        <Button type="primary" @click="submitReview">提交</Button>
    </div>
  </Modal>
</template>

<script>

export default {
  // name: "supplier-manage",
  props:{
    isShow: {
      type: Boolean,
      default: false
    },
    // reviewObject: {
    //   type: Object,
    //   default: false
    // }
    reviewModalTitle: {
      type: String,
      default: ""
    },
    reviewStatus: {
      type: String,
      default: ""
    },
  },
  data() {
    return {
      modalTitle: this.reviewModalTitle,
      reviewForm: {
        reviewStatus: this.reviewStatus,
        nopassReason: "",
        nopassReasonVisible: false
      },
      reviewFormValidate: {
      }
    };
  },
  // created: function () {
  //   console.log("=====================");
  //   console.log(this.reviewObject);
  // },
 
  methods: {
    revewStatusChange(value) {
      (value === "-1") ? (this.reviewForm.nopassReasonVisible = true) : (this.reviewForm.nopassReasonVisible = false);
    },
    cancelReview() {
      console.log("========cancelReview=======");
      // this.hotelReviewModalVisible = false;
      console.log(this.isShow);
      this.$emit('on-close',true);
    },
    submitReview(){
      console.log("=============submitReview============");
    }

  },
  mounted() {
  }
};
</script>